<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$plugintable = DB::table('yy_pay');
$plugintablelog = DB::table('yy_pay_log');
$sql = <<<EOF

DROP TABLE IF EXISTS {$plugintable};
CREATE TABLE {$plugintable} (
  `p_id` int(11) NOT NULL AUTO_INCREMENT,
  `p_pid` int(11) NOT NULL DEFAULT '0',
  `p_cid` int(11) NOT NULL DEFAULT '0',
  `p_pay` int(11) DEFAULT '0',
  `p_extcredit` INT(11) NULL DEFAULT '0',
  `p_authorid` int(11) DEFAULT '0',
  `p_time` TIMESTAMP NULL  DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`p_id`)
)TYPE=MyISAM;
DROP TABLE IF EXISTS {$plugintablelog};
CREATE TABLE {$plugintablelog} (
  `pl_id` int(11) NOT NULL AUTO_INCREMENT,
  `pl_pid` int(11) DEFAULT NULL,
  `pl_cid` int(11) DEFAULT NULL,
  `pl_uid` int(11) DEFAULT NULL,
  `pl_uname` varchar(45) DEFAULT NULL,
  `pl_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `pl_pay` int(11) DEFAULT NULL,
  `pl_authorid` int(11) DEFAULT NULL,
  `pl_authorincome` int(11) DEFAULT NULL,
  `pl_extcredit` int(11) DEFAULT NULL,
  PRIMARY KEY (`pl_id`)
)TYPE=MyISAM;
EOF;

runquery($sql);
$finish = TRUE;

?>